package com.kaishengit.service;

import java.util.List;

import com.kaishengit.dao.PublishDao;
import com.kaishengit.entity.Publish;
import com.kaishengit.util.StringUtil;
import com.kaishengit.util.db.Page;

public class PublishService {

	private PublishDao publishDao = new PublishDao();
	
	public Page<Publish> findByPage(int pageNum) {
		return publishDao.findByPage(pageNum);
	}

	public void save(String pubName) {
		Publish p = new Publish();
		p.setId(StringUtil.getId());
		p.setPubname(pubName);
		publishDao.save(p);
	}

	public List<Publish> findAll() {
		return publishDao.findAll();
	}
}
